package student.test.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import student.test.DAO.StudentDAO;
import student.test.entity.Student;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    StudentDAO studentDAO;
    public int addStudent(Student student){
        return studentDAO.addStudent(student);
    }
    public int updateStudent(Student student){
        return studentDAO.updateStudent(student);
    }
    public int deleteStudentById(Integer id){
        return studentDAO.deleteStudentById(id);
    }
    public Student getStudentById(Integer id){
        return studentDAO.getStudentById(id);
    }
    public List<Student> getAllStudents(){
        return studentDAO.getAllStudents();
    }
}
